#ifndef _CRATE_H_
#define _CRATE_H_

#include <stdio.h>
#include "../../ExEngine/common/hashtable.hpp"
#include "../../ExEngine/common/arraylist.hpp"

#include "../../ExEngine/render/interface_types.h"
#include "../../ExEngine/sound/dsound.h"

HRESULT LoadDemo(); 
HRESULT ShutdownDemo(); 
HRESULT UpdateDemo(const float dt); 

class CCrate : public CObject
{
private:

	bool m_isValid;
	void UpdateTransform();

public:
	
	typedef  void (CCrate::*EvtHandler)(void);
	void CallEvent(EvtHandler memFn)
	{
		(this->*(memFn))();
	}

	void Idle();

	CCrate();
	HRESULT Create();
	HRESULT Release();
	
	
	void OnCollisionEvent(const Vector3f& contactPoint, const Vector3f& contactNormal, CObject* pOtherObject);
	void setPosition(const Vector3f &position); 

	void Update(const float dt);
	void Draw(void); 

	bool isValid();
};

#endif